import { message as http } from '@zh/common-utils/http'

export { http }

/**
 * 查询分页列表
 * @param {Object} params
 */
export function getMessagePage (params) {
  return http.post('/message/MessageSendInside/queryPage', params)
}

/**
 * 根据id返回信息
 * @param {String} id
 */
export function getMessageInfoById (msgId) {
  return http.get(`message/MessageInfo/get/${msgId}`)
}

/**
 * 根据id修改消息状态
 * @param {String} id
 */
export function updateReadStatusOne (insideMsgId) {
  return http.get(`message/MessageSendInside/updateReadStatusOne/${insideMsgId}`)
}

/**
 * 批量修改消息状态
 * @param {String} ids
 */
export function updateReadStatusList (params) {
  return http.post('/message/MessageSendInside/updateReadStatusList', params)
}

/**
 * 删除
 * @param {String} ids
 */
export function deleteMessages (params) {
  return http.post('/message/MessageSendInside/deletes', params)
}

// 消息状态改为已读
export function editMsgStatus (params) {
  return http.get('/message/MessageSendInside/updateReadStatusOne/' + params)
}

// 应用列表对应的未读数量
export function getAppMsgCount () {
  return http.post('/message/MessageSendInside/getMessageCountByCategory/1')
}

// 消息全部已读
export function updateAllReadStatus () {
  return http.post('/message/MessageSendInside/updateReadStatus')
}
// 消息抄送，系统应用数量
export function getUnreadNum () {
  return http.get('/message/MessageSendInside/unreadNum')
}
/**
 * 查询消息列表
 * @param {Object} param 分页
 */
export function messageQueryPage (param) {
  return http.post('/message/MessageSendInside/queryPage', param)
}

/**
 * 标记消息已读
 * @param {Object} param 分页
 */
export function markAllMsgRead () {
  return http.post('/message/MessageSendInside/updateReadStatus')
}